
function search_web(){
	var word = document.getElementById('key_word').value;
	if(word==''){
		alert('请输入要搜索的内容');
		return false;
	}
	$('#tbm').remove();
	eval(document.getElementById('type').value+'(word)');
	return false;
}


var now_ser;
var search_arr = new Array();
search_arr['google']={'url':'http://www.google.com.hk/','key':'q','chuan':'#&','news':''};
search_arr['baidu']={'url':'http://www.baidu.com/s','key':'wd','chuan':'?'};
search_arr['yahoo']={'url':'http://www.yahoo.cn/s','key':'q','chuan':'?'};
search_arr['bing']={'url':'http://cn.bing.com/search','key':'q','chuan':'?'};
function web(word){
	var ser = document.getElementById('service').value.toLowerCase();
	var a = '<input type="hidden" value="'+word+'" id="'+search_arr[ser]['key']+'" name="'+search_arr[ser]['key']+'" />';
	$('#'+search_arr[now_ser]['key']).remove();
	$('#service').after(a);
	now_ser=ser;
	var action = search_arr[ser]['url'];
	if(ser == 'google'){
		action = search_arr[ser]['url']+search_arr[ser]['chuan']+search_arr[ser]['key']+'='+word;
	}
	document.getElementById('search_form').action=action;
	document.getElementById('search_form').submit();
}


var news_ser;
var news_arr = new Array();
news_arr['google']={'url':'http://www.google.com.hk/','key':'q','chuan':'#&'};
news_arr['baidu']={'url':'http://news.baidu.com/ns','key':'word','chuan':'?'};
news_arr['yahoo']={'url':'http://news.yahoo.cn/s','key':'q','chuan':'?'};
news_arr['bing']={'url':'http://cn.bing.com/news/search?','key':'q','chuan':'?'};
function news(word){
	var ser = document.getElementById('service').value.toLowerCase();
	var a = '<input type="hidden" value="'+word+'" id="'+news_arr[ser]['key']+'" name="'+news_arr[ser]['key']+'" />';
	$('#'+news_arr[news_ser]['key']).remove();
	$('#service').after(a);
	news_ser=ser;
	var action = news_arr[ser]['url'];
	if(ser == 'google'){
		action = search_arr[ser]['url']+search_arr[ser]['chuan']+search_arr[ser]['key']+'='+word;
	}
	document.getElementById('search_form').action=action;
	document.getElementById('search_form').submit();
}

var mp3_ser;
var mp3_arr = new Array();
mp3_arr['google']={'url':'http://www.google.cn/music/search','key':'q','chuan':'?'};
mp3_arr['baidu']={'url':'http://mp3.baidu.com/m','key':'word','chuan':'?'};
mp3_arr['yahoo']={'url':'http://music.yahoo.cn/s','key':'q','chuan':'?'};
mp3_arr['bing']={'url':'http://cn.bing.com/search','key':'q','chuan':'?'};
function mp3(word){
	var ser = document.getElementById('service').value.toLowerCase();
	var a = '<input type="hidden" value="'+word+'" id="'+mp3_arr[ser]['key']+'" name="'+mp3_arr[ser]['key']+'" />';
	$('#'+mp3_arr[mp3_ser]['key']).remove();
	$('#service').after(a);
	mp3_ser=ser;
	var action = mp3_arr[ser]['url'];
	
	document.getElementById('search_form').action=action;
	document.getElementById('search_form').submit();
}


var video_ser;
var video_arr = new Array();
video_arr['google']={'url':'http://www.google.com.hk/search','key':'q','chuan':'?'};
video_arr['baidu']={'url':'http://video.baidu.com/v','key':'word','chuan':'?'};
video_arr['yahoo']={'url':'http://www.yahoo.cn/s','key':'q','chuan':'?'};
video_arr['bing']={'url':'http://cn.bing.com/videos/search','key':'q','chuan':'?'};
function video(word){
	var ser = document.getElementById('service').value.toLowerCase();
	var a = '<input type="hidden" value="'+word+'" id="'+video_arr[ser]['key']+'" name="'+video_arr[ser]['key']+'" />';
	$('#'+video_arr[video_ser]['key']).remove();
	$('#service').after(a);
	video_ser=ser;
	var action = video_arr[ser]['url'];
	if(ser == 'google'){
		$('#service').after('<input type="hidden" value="vid" id="tbm" name="tbm" />'	);
	}
	
	document.getElementById('search_form').action=action;
	document.getElementById('search_form').submit();
}

var photo_ser;
var photo_arr = new Array();
photo_arr['google']={'url':'http://www.google.com.hk/search','key':'q','chuan':'?'};
photo_arr['baidu']={'url':'http://image.baidu.com/i','key':'word','chuan':'?'};
photo_arr['yahoo']={'url':'http://image.yahoo.cn/s','key':'q','chuan':'?'};
photo_arr['bing']={'url':'http://cn.bing.com/images/search','key':'q','chuan':'?'};
function photo(word){
	var ser = document.getElementById('service').value.toLowerCase();
	var a = '<input type="hidden" value="'+word+'" id="'+photo_arr[ser]['key']+'" name="'+photo_arr[ser]['key']+'" />';
	$('#'+photo_arr[photo_ser]['key']).remove();
	$('#service').after(a);
	photo_ser=ser;
	var action = photo_arr[ser]['url'];
	if(ser == 'google'){
		$('#service').after('<input type="hidden" value="isch" id="tbm" name="tbm" />'	);
	}
	
	document.getElementById('search_form').action=action;
	document.getElementById('search_form').submit();
}

var fanyi_ser;
var fanyi_arr = new Array();
fanyi_arr['google']={'url':'http://translate.google.cn/','key':'q','chuan':'?'};
fanyi_arr['baidu']={'url':'http://fanyi.baidu.com/','key':'word','chuan':'#auto2auto|'};
fanyi_arr['yahoo']={'url':'http://www.yahoo.cn/s','key':'q','chuan':'?'};
fanyi_arr['bing']={'url':'http://dict.bing.com.cn/','key':'q','chuan':'?'};
function fanyi(word){
	var ser = document.getElementById('service').value.toLowerCase();
	var a = '<input type="hidden" value="'+word+'" id="'+fanyi_arr[ser]['key']+'" name="'+fanyi_arr[ser]['key']+'" />';
	$('#'+fanyi_arr[fanyi_ser]['key']).remove();
	$('#service').after(a);
	fanyi_ser=ser;
	var action = fanyi_arr[ser]['url'];
	if(ser == 'baidu'){
		action = fanyi_arr[ser]['url']+fanyi_arr[ser]['chuan']+fanyi_arr[ser]['key']+'='+word;
	}
	
	document.getElementById('search_form').action=action;
	document.getElementById('search_form').submit();
}

var map_ser;
var map_arr = new Array();
map_arr['google']={'url':'http://ditu.google.cn/maps','key':'q','chuan':'?'};
map_arr['baidu']={'url':'http://map.baidu.com/','key':'word','chuan':'?'};
map_arr['yahoo']={'url':'http://ditu.yahoo.cn/','key':'q','chuan':'?'};
map_arr['bing']={'url':'http://cn.bing.com/ditu/','key':'q','chuan':'?'};
function map(word){
	var ser = document.getElementById('service').value.toLowerCase();
	var a = '<input type="hidden" value="'+word+'" id="'+map_arr[ser]['key']+'" name="'+map_arr[ser]['key']+'" />';
	$('#'+map_arr[map_ser]['key']).remove();
	$('#service').after(a);
	map_ser=ser;
	var action = map_arr[ser]['url'];
	
	
	document.getElementById('search_form').action=action;
	document.getElementById('search_form').submit();
}


function taobao(word){
	document.getElementById('search_form').action='/index.php/index/taobao/';
	var a = '<input type="hidden" value="'+word+'" id="q" name="q" />';
	$('#q').remove();
	$('#service').after(a);
	document.getElementById('search_form').submit();
}

function weibo(word){
	document.getElementById('search_form').action='/index.php/index/weibo/';
	var a = '<input type="hidden" value="'+word+'" id="q" name="q" />';
	$('#q').remove();
	$('#service').after(a);
	document.getElementById('search_form').submit();
}